<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>需求列表 - 社交平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #818cf8;
            --primary-dark: #3730a3;
            --secondary: #ec4899;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --bg-gray: #f1f5f9;
            --bg-gray-dark: #e2e8f0;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --radius: 12px;
            --radius-sm: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
            flex: 1;
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        .nav-action.primary {
            color: var(--primary);
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
            background-color: var(--bg-gray);
            border-radius: 24px;
            padding: 8px 16px;
            display: flex;
            align-items: center;
        }
        
        .search-icon {
            color: var(--text-tertiary);
            font-size: 0.95rem;
            margin-right: 8px;
        }
        
        .search-input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            font-size: 0.9rem;
            color: var(--text-primary);
        }
        
        .search-input::placeholder {
            color: var(--text-tertiary);
        }
        
        /* 筛选栏 */
        .filters {
            display: flex;
            padding: 8px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            overflow-x: auto;
            scrollbar-width: none;
            gap: 8px;
        }
        
        .filters::-webkit-scrollbar {
            display: none;
        }
        
        .filter-item {
            white-space: nowrap;
            padding: 6px 12px;
            border-radius: 16px;
            font-size: 0.85rem;
            background-color: var(--bg-gray);
            color: var(--text-secondary);
            border: none;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .filter-item.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-item .icon {
            font-size: 0.9rem;
        }
        
        /* 分类栏 */
        .categories {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .category-title {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 10px;
            color: var(--text-primary);
        }
        
        .category-options {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            scrollbar-width: none;
            padding-bottom: 4px;
        }
        
        .category-options::-webkit-scrollbar {
            display: none;
        }
        
        .category-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 60px;
            text-decoration: none;
            color: var(--text-secondary);
        }
        
        .category-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: var(--bg-gray);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 4px;
            font-size: 1rem;
        }
        
        .category-option.active .category-icon {
            background-color: var(--primary);
            color: white;
        }
        
        .category-name {
            font-size: 0.75rem;
            text-align: center;
        }
        
        .category-option.active .category-name {
            color: var(--primary);
            font-weight: 500;
        }
        
        /* 需求列表容器 */
        .demands-container {
            padding: 12px 16px;
        }
        
        /* 需求列表样式 - 通用 */
        .demand-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 16px;
            box-shadow: var(--shadow);
            text-decoration: none;
            color: var(--text-primary);
            transition: transform 0.2s ease;
        }
        
        .demand-card:hover {
            transform: translateY(-2px);
        }
        
        .demand-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .requester-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background-color: var(--bg-gray);
            flex-shrink: 0;
            overflow: hidden;
        }
        
        .requester-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .requester-info {
            flex: 1;
        }
        
        .requester-name {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 2px;
        }
        
        .demand-time {
            font-size: 0.75rem;
            color: var(--text-tertiary);
        }
        
        .verify-badge {
            color: var(--primary);
            font-size: 0.75rem;
            margin-left: 4px;
        }
        
        /* 需求内容区域 */
        .demand-content {
            padding: 0 16px 12px;
        }
        
        .demand-title {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 6px;
            color: var(--text-primary);
        }
        
        .demand-description {
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 8px;
        }
        
        /* 预算标签 */
        .budget-tag {
            display: inline-block;
            padding: 3px 10px;
            background-color: rgba(79, 70, 229, 0.1);
            color: var(--primary);
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 500;
            margin-bottom: 10px;
        }
        
        /* 图片样式变体 */
        .demand-no-image .demand-content {
            padding-bottom: 16px;
        }
        
        .demand-single-image .demand-image {
            width: 100%;
            height: 200px;
            position: relative;
            margin-bottom: 12px;
        }
        
        .demand-single-image .demand-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: var(--radius-sm);
        }
        
        .demand-multi-image .demand-images {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            margin-bottom: 12px;
        }
        
        .demand-multi-image .demand-image {
            aspect-ratio: 1;
            position: relative;
        }
        
        .demand-multi-image .demand-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: var(--radius-sm);
        }
        
        .image-count-overlay {
            position: absolute;
            bottom: 4px;
            right: 4px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 标签区域 */
        .tags-container {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 10px;
        }
        
        .tag {
            background-color: var(--bg-gray);
            color: var(--text-secondary);
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
        }
        
        /* 需求数据统计 */
        .demand-stats {
            display: flex;
            justify-content: space-between;
            padding: 8px 16px;
            border-top: 1px solid var(--border-light);
            font-size: 0.8rem;
            color: var(--text-tertiary);
        }
        
        .demand-stat-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .stat-value {
            font-weight: 600;
            color: var(--text-primary);
        }
        
        /* 行动按钮 */
        .demand-actions {
            display: flex;
            gap: 8px;
            padding: 0 16px 12px;
        }
        
        .demand-btn {
            flex: 1;
            padding: 8px;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .primary-btn {
            background-color: var(--primary);
            color: white;
        }
        
        .secondary-btn {
            background-color: var(--bg-gray);
            color: var(--text-secondary);
        }
        
        /* 加载更多 */
        .load-more {
            padding: 16px 0;
            text-align: center;
        }
        
        .load-more-btn {
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            padding: 8px 24px;
            border-radius: 20px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 auto;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            gap: 4px;
            flex: 1;
            height: 100%;
            text-decoration: none;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 1.2rem;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">需求列表</div>
        <button class="nav-action primary" id="addDemandBtn">
            <i class="fas fa-plus"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索需求、服务或请求者...">
        </div>
    </div>
    
    <!-- 筛选栏 -->
    <div class="filters">
        <button class="filter-item active">
            <span>全部</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-clock icon"></i>
            <span>最新发布</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-fire icon"></i>
            <span>热门需求</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-money-bill icon"></i>
            <span>预算从高到低</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-map-marker-alt icon"></i>
            <span>附近优先</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-sliders icon"></i>
            <span>更多筛选</span>
        </button>
    </div>
    
    <!-- 分类栏 -->
    <div class="categories">
        <div class="category-title">需求分类</div>
        <div class="category-options">
            <a href="#" class="category-option active">
                <div class="category-icon">
                    <i class="fas fa-th"></i>
                </div>
                <div class="category-name">全部</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-laptop"></i>
                </div>
                <div class="category-name">数码</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-home"></i>
                </div>
                <div class="category-name">家居</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-car"></i>
                </div>
                <div class="category-name">出行</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-tools"></i>
                </div>
                <div class="category-name">维修</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-hands-helping"></i>
                </div>
                <div class="category-name">服务</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-graduation-cap"></i>
                </div>
                <div class="category-name">教育</div>
            </a>
            <a href="#" class="category-option">
                <div class="category-icon">
                    <i class="fas fa-plus-circle"></i>
                </div>
                <div class="category-name">更多</div>
            </a>
        </div>
    </div>
    
    <!-- 需求列表容器 -->
    <div class="demands-container">
        <!-- 需求卡片 - 多图片样式 -->
        <div class="demand-card demand-multi-image">
            <div class="demand-header">
                <div class="requester-avatar">
                    <img src="https://picsum.photos/id/64/100/100" alt="用户头像">
                </div>
                <div class="requester-info">
                    <div class="requester-name">
                        张小明 <i class="fas fa-check-circle verify-badge"></i>
                    </div>
                    <div class="demand-time">2小时前</div>
                </div>
            </div>
            <div class="demand-content">
                <div class="demand-title">求购二手摄影器材一套</div>
                <div class="demand-description">
                    寻找一套入门级摄影器材，包含相机机身和镜头，最好是佳能或尼康品牌，成色较新，功能完好。
                </div>
                <div class="budget-tag">预算 ¥3000-5000</div>
                <div class="tags-container">
                    <span class="tag">摄影器材</span>
                    <span class="tag">求购</span>
                    <span class="tag">可议价</span>
                </div>
                <div class="demand-images">
                    <div class="demand-image">
                        <img src="https://picsum.photos/id/237/300/300" alt="参考图1">
                    </div>
                    <div class="demand-image">
                        <img src="https://picsum.photos/id/96/300/300" alt="参考图2">
                    </div>
                    <div class="demand-image">
                        <img src="https://picsum.photos/id/201/300/300" alt="参考图3">
                        <div class="image-count-overlay">+2</div>
                    </div>
                </div>
            </div>
            <div class="demand-stats">
                <div class="demand-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">215</span>
                    <span>浏览</span>
                </div>
                <div class="demand-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">32</span>
                    <span>回应</span>
                </div>
                <div class="demand-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>2.5km</span>
                </div>
            </div>
            <div class="demand-actions">
                <button class="demand-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>我能提供</span>
                </button>
                <button class="demand-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 需求卡片 - 单图片样式 -->
        <div class="demand-card demand-single-image">
            <div class="demand-header">
                <div class="requester-avatar">
                    <img src="https://picsum.photos/id/65/100/100" alt="用户头像">
                </div>
                <div class="requester-info">
                    <div class="requester-name">
                        李华 <i class="fas fa-check-circle verify-badge"></i>
                    </div>
                    <div class="demand-time">昨天 10:15</div>
                </div>
            </div>
            <div class="demand-content">
                <div class="demand-title">寻求笔记本电脑维修服务</div>
                <div class="demand-description">
                    笔记本电脑无法开机，可能是电池或主板问题，希望找专业人士维修，最好能上门服务，品牌是联想。
                </div>
                <div class="budget-tag">预算 ¥100-500</div>
                <div class="tags-container">
                    <span class="tag">电脑维修</span>
                    <span class="tag">服务</span>
                    <span class="tag">上门服务</span>
                </div>
                <div class="demand-image">
                    <img src="https://picsum.photos/id/180/600/400" alt="故障电脑">
                </div>
            </div>
            <div class="demand-stats">
                <div class="demand-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">186</span>
                    <span>浏览</span>
                </div>
                <div class="demand-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">17</span>
                    <span>回应</span>
                </div>
                <div class="demand-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>3.8km</span>
                </div>
            </div>
            <div class="demand-actions">
                <button class="demand-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>我能提供</span>
                </button>
                <button class="demand-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 需求卡片 - 无图片样式 -->
        <div class="demand-card demand-no-image">
            <div class="demand-header">
                <div class="requester-avatar">
                    <img src="https://picsum.photos/id/22/100/100" alt="用户头像">
                </div>
                <div class="requester-info">
                    <div class="requester-name">
                        王芳 <i class="fas fa-check-circle verify-badge"></i>
                    </div>
                    <div class="demand-time">3天前</div>
                </div>
            </div>
            <div class="demand-content">
                <div class="demand-title">寻找周末钢琴教师</div>
                <div class="demand-description">
                    为8岁孩子寻找钢琴教师，周末上课，有经验优先，地点在高新区，希望价格合理，能长期教学。
                </div>
                <div class="budget-tag">预算 ¥150-200/课时</div>
                <div class="tags-container">
                    <span class="tag">教育培训</span>
                    <span class="tag">音乐</span>
                    <span class="tag">周末</span>
                </div>
            </div>
            <div class="demand-stats">
                <div class="demand-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">324</span>
                    <span>浏览</span>
                </div>
                <div class="demand-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">28</span>
                    <span>回应</span>
                </div>
                <div class="demand-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>5.2km</span>
                </div>
            </div>
            <div class="demand-actions">
                <button class="demand-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>我能提供</span>
                </button>
                <button class="demand-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 需求卡片 - 多图片样式 -->
        <div class="demand-card demand-multi-image">
            <div class="demand-header">
                <div class="requester-avatar">
                    <img src="https://picsum.photos/id/91/100/100" alt="用户头像">
                </div>
                <div class="requester-info">
                    <div class="requester-name">
                        赵伟
                    </div>
                    <div class="demand-time">1周前</div>
                </div>
            </div>
            <div class="demand-content">
                <div class="demand-title">求购二手家具一套</div>
                <div class="demand-description">
                    新租房需要添置家具，求购沙发、餐桌椅和床，成色较新，无明显损坏，可整套购买，也可分开购买。
                </div>
                <div class="budget-tag">预算 ¥5000-8000</div>
                <div class="tags-container">
                    <span class="tag">家居用品</span>
                    <span class="tag">求购</span>
                    <span class="tag">可自提</span>
                </div>
                <div class="demand-images">
                    <div class="demand-image">
                        <img src="https://picsum.photos/id/116/300/300" alt="沙发参考">
                    </div>
                    <div class="demand-image">
                        <img src="https://picsum.photos/id/174/300/300" alt="餐桌参考">
                    </div>
                    <div class="demand-image">
                        <img src="https://picsum.photos/id/183/300/300" alt="床参考">
                    </div>
                </div>
            </div>
            <div class="demand-stats">
                <div class="demand-stat-item">
                    <i class="far fa-eye"></i>
                    <span class="stat-value">412</span>
                    <span>浏览</span>
                </div>
                <div class="demand-stat-item">
                    <i class="far fa-comment"></i>
                    <span class="stat-value">45</span>
                    <span>回应</span>
                </div>
                <div class="demand-stat-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>8.7km</span>
                </div>
            </div>
            <div class="demand-actions">
                <button class="demand-btn primary-btn">
                    <i class="fas fa-comment"></i>
                    <span>我能提供</span>
                </button>
                <button class="demand-btn secondary-btn">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 加载更多 -->
    <div class="load-more">
        <button class="load-more-btn" id="loadMoreBtn">
            <i class="fas fa-spinner fa-spin" style="display: none;"></i>
            <span>加载更多</span>
        </button>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-list-alt nav-icon"></i>
            <span>需求</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const addDemandBtn = document.getElementById('addDemandBtn');
        const filterItems = document.querySelectorAll('.filter-item');
        const categoryOptions = document.querySelectorAll('.category-option');
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        const demandBtns = document.querySelectorAll('.demand-btn');
        const navItems = document.querySelectorAll('.nav-item');
        
        // 筛选器切换
        filterItems.forEach(item => {
            item.addEventListener('click', function() {
                filterItems.forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                const filterText = this.querySelector('span').textContent;
                showToast(`已切换到${filterText}`);
            });
        });
        
        // 分类选项切换
        categoryOptions.forEach(option => {
            option.addEventListener('click', function(e) {
                e.preventDefault();
                categoryOptions.forEach(opt => opt.classList.remove('active'));
                this.classList.add('active');
                const categoryName = this.querySelector('.category-name').textContent;
                showToast(`已选择${categoryName}分类`);
            });
        });
        
        // 加载更多
        loadMoreBtn.addEventListener('click', function() {
            const spinner = this.querySelector('.fa-spinner');
            const text = this.querySelector('span');
            const originalText = text.textContent;
            
            spinner.style.display = 'inline-block';
            text.textContent = '加载中...';
            this.disabled = true;
            
            setTimeout(() => {
                spinner.style.display = 'none';
                text.textContent = originalText;
                this.disabled = false;
                showToast('已加载更多需求信息');
            }, 1500);
        });
        
        // 需求卡片操作按钮
        demandBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                const actionText = this.querySelector('span').textContent;
                const demandTitle = this.closest('.demand-card').querySelector('.demand-title').textContent;
                
                if (actionText === '收藏') {
                    // 切换收藏状态
                    const icon = this.querySelector('i');
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        showToast(`已收藏: ${demandTitle}`);
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        showToast(`已取消收藏: ${demandTitle}`);
                    }
                } else {
                    showToast(`${actionText}: ${demandTitle}`);
                }
            });
        });
        
        // 其他按钮事件
        backBtn.addEventListener('click', function() {
            history.back();
        });
        
        addDemandBtn.addEventListener('click', function() {
            showToast('发布新需求页面已打开');
        });
        
        // 底部导航点击
        navItems.forEach(item => {
            item.addEventListener('click', function(e) {
                e.preventDefault();
                navItems.forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                const title = this.querySelector('span').textContent;
                showToast(`已切换到${title}`);
            });
        });
        
        // 提示消息功能
        function showToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
    </script>
</body>
</html>

